package com.moge.anjian.manager;

import android.content.Context;

import com.moge.anjian.App;
import com.moge.anjian.view.TargetView;

import java.util.ArrayList;
import java.util.List;

public class TargetManager {

    private static TargetManager instance = new TargetManager();
    List<TargetView> viewList = new ArrayList<>();

    private TargetManager() {
    }

    public static TargetManager getInstance() {
        return instance;
    }

    public int addTargetView(Context context) {
        int index = viewList.size();
        TargetView targetView = new TargetView(context, index);
        targetView.addWindow();
        viewList.add(targetView);
        return index;
    }

    public List<TargetView> getViewList() {
        return viewList;
    }

    public void cleanWindow() {
        for (TargetView view : viewList) {
            App.manager.removeView(view);
        }
    }
}
